<?php

/*
 * This file is the jQuery for adding a track document in the view page of main document.
 * 
 * Created by: Peter Agno Jr.
 * Date created: October 25, 2011
 */
?>

    // Start - function of adding a track document in the first row of the logs
            // This will adjust the scroll bar to center
            jQuery(".trackCirclesScroll").scrollLeft(1032); 
            
            function addTrackDoc (varAddInfoHere, varDocumentId) {
                var varPageCalled = "mainDocPg";
                
                jQuery.ajax({
                    type : 'POST',
                    url : 'ajaxRequests/addTrackDocInfo.php',
                    dataType : 'json',
                    async : false,
                    data: {
                        documentId : varDocumentId,
                        pageCalled : varPageCalled
                    },
                    success : function(data){
                       jQuery(varAddInfoHere).prepend(data.trackDocInfo);
                    },
                    error : function() {
                        alert("Error in getting the track document.");
                    }
                });
            } // End - function of adding a track document in the first row of the logs
